FROM golang AS build-env
ADD . /go/src/app
WORKDIR /go/src/app
RUN GOOS=linux GOARCH=386 go build -v -o /go/src/app/httpserver

FROM alpine
RUN apk add -U tzdata && \
    ln -sf /usr/share/zoneinfo/Asia/Shanghai  /etc/localtime
COPY --from=build-env /go/src/app/httpserver /root/httpserver
EXPOSE 8080
WORKDIR /root
CMD [ "./httpserver" ]